package com.wjw.java.games.tankgame4;

/**
 * 炸弹类：
 */
public class Bomb {

    private int x;//x坐标
    private int y;//y坐标
    private int life = 9;//炸弹的生命周期
    private boolean isLive = true;//是否还存活

    //减少炸弹生命值,配合出现图片的爆炸效果
    public void lifeDown(){
        if(life > 0){
            life --;
        }else{
            isLive = false;
        }
    }

    //getter、setter、构造器
    public int getX() {
        return this.x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return this.y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getLife() {
        return this.life;
    }

    public void setLife(int life) {
        this.life = life;
    }

    public boolean isLive() {
        return this.isLive;
    }

    public void setLive(boolean live) {
        this.isLive = live;
    }

    public Bomb(int x, int y) {
        this.x = x;
        this.y = y;
    }
}
